home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / update~1.z / update~1 / gkernel / fs / fs.diff
Encoding:
Text File  |  1989-08-24  |  7.5 KB  |  220 lines

  1. *** /tmp/,RCSt1a27309    Thu Aug 24 00:02:48 1989
  2. --- Makefile.rs.root    Wed Aug 23 22:56:27 1989
  3. ***************
  4. *** 1,6 ****
  5.   #
  6.   # Makefile for HCJ rs232 + screen + mouse + ptrace + newflop + wantformat
  7. ! # root on wini (on dev 3,2 in my case)
  8.   #
  9.   CROSSDIR = /dsrg/bammi/cross-minix
  10.   CROSSLIB = $(CROSSDIR)/lib
  11. --- 1,6 ----
  12.   #
  13.   # Makefile for HCJ rs232 + screen + mouse + ptrace + newflop + wantformat
  14. ! # root on wini (on dev 3,2 in my case) bigger cache buf
  15.   #
  16.   CROSSDIR = /dsrg/bammi/cross-minix
  17.   CROSSLIB = $(CROSSDIR)/lib
  18. ***************
  19. *** 9,15 ****
  20.   LD    = $(CROSSLIB)/gcc-ld
  21.   l    = $(CROSSLIB)
  22.   DEFS    = -DKERNEL -DWANTDISKROOT -DWANT_HCJ_RS232 -DWANTSCREEN \
  23. ! -DWANTMOUSE -DWANTPTRACE -DWANTNEWFLOP -DWANTFORMAT
  24.   
  25.   CFLAGS    = -O -Wall -DATARI_ST $(DEFS) -I. -I../h -mshort \
  26.       -fomit-frame-pointer -fcombine-regs
  27. --- 9,15 ----
  28.   LD    = $(CROSSLIB)/gcc-ld
  29.   l    = $(CROSSLIB)
  30.   DEFS    = -DKERNEL -DWANTDISKROOT -DWANT_HCJ_RS232 -DWANTSCREEN \
  31. ! -DWANTMOUSE -DWANTPTRACE -DWANTNEWFLOP -DWANTFORMAT -DBIGGER_BUF
  32.   
  33.   CFLAGS    = -O -Wall -DATARI_ST $(DEFS) -I. -I../h -mshort \
  34.       -fomit-frame-pointer -fcombine-regs
  35. *** /tmp/,RCSt1a27309    Thu Aug 24 00:02:49 1989
  36. --- buf.h    Sat Aug 19 00:56:19 1989
  37. ***************
  38. *** 59,64 ****
  39. --- 59,65 ----
  40.   /* When a block is released, the type of usage is passed to put_block(). */
  41.   #define WRITE_IMMED        0100    /* block should be written to disk now */
  42.   #define ONE_SHOT           0200    /* set if block not likely to be needed soon */
  43. + #if 0
  44.   #define INODE_BLOCK        0 + WRITE_IMMED         /* inode block */
  45.   #define DIRECTORY_BLOCK    1 + WRITE_IMMED         /* directory block */
  46.   #define INDIRECT_BLOCK     2 + WRITE_IMMED         /* pointer block */
  47. ***************
  48. *** 65,69 ****
  49. --- 66,78 ----
  50.   #define I_MAP_BLOCK        3 + WRITE_IMMED + ONE_SHOT     /* inode bit map */
  51.   #define ZMAP_BLOCK         4 + WRITE_IMMED + ONE_SHOT     /* free zone map */
  52.   #define ZUPER_BLOCK        5 + WRITE_IMMED + ONE_SHOT     /* super block */
  53. + #else
  54. + #define INODE_BLOCK        0          /* inode block */
  55. + #define DIRECTORY_BLOCK    1          /* directory block */
  56. + #define INDIRECT_BLOCK     2          /* pointer block */
  57. + #define I_MAP_BLOCK        3 + WRITE_IMMED + ONE_SHOT     /* inode bit map */
  58. + #define ZMAP_BLOCK         4 + WRITE_IMMED + ONE_SHOT     /* free zone map */
  59. + #define ZUPER_BLOCK        5 + WRITE_IMMED + ONE_SHOT     /* super block */
  60. + #endif
  61.   #define FULL_DATA_BLOCK    6                   /* data, fully used */
  62.   #define PARTIAL_DATA_BLOCK 7                  /* data, partly used */
  63. *** /tmp/,RCSt1a27309    Thu Aug 24 00:02:51 1989
  64. --- cache.c    Wed Aug 23 23:17:12 1989
  65. ***************
  66. *** 87,94 ****
  67. --- 87,143 ----
  68.           }
  69.     }
  70.   
  71. + #if 0
  72.     /* If the  block taken is dirty, make it clean by rewriting it to disk. */
  73.     if (bp->b_dirt == DIRTY && bp->b_dev != NO_DEV) rw_block(bp, WRITING);
  74. + #else
  75. +   /* write all the dirty blocks of this device,
  76. +      (this idea thanks to bruce evans)
  77. +      update: incorporated elevator algorithm
  78. +               to write all dirty blocks
  79. +               ++jrb
  80. +    */
  81. +   if (bp->b_dirt == DIRTY && bp->b_dev != NO_DEV)
  82. +   {
  83. +       register struct buf *flbp;
  84. +       register block_nr   cb;
  85. +       register short      all_not_done;
  86. +       
  87. +       do 
  88. +       {
  89. +       /* elevate from lower to higher blocks */
  90. +       for (flbp = front, all_not_done = 0, cb = (block_nr)0; flbp;
  91. +            flbp = flbp->b_next) 
  92. +       {
  93. +           if (flbp->b_dev == bp->b_dev && flbp->b_dirt == DIRTY)
  94. +           if(flbp->b_blocknr >= cb)
  95. +           {
  96. +               rw_block(flbp, WRITING);
  97. +               cb = flbp->b_blocknr;
  98. +           }
  99. +           else
  100. +               all_not_done++;
  101. +       }
  102. +       if(all_not_done > 0)
  103. +       {
  104. +           /* elevate down  from higher to lower blocks */
  105. +           for (flbp = front, all_not_done = 0; flbp; flbp = flbp->b_next)
  106. +           {
  107. +           if (flbp->b_dev == bp->b_dev && flbp->b_dirt == DIRTY)
  108. +               if(flbp->b_blocknr < cb)
  109. +               {
  110. +               rw_block(flbp, WRITING);
  111. +               cb = flbp->b_blocknr;
  112. +               }
  113. +               else
  114. +               all_not_done++;
  115. +           }
  116. +       }
  117. +       } while (all_not_done > 0); /* keep doing until all dirty blocks on */
  118. +                   /* device are written */
  119. +       
  120. +   }
  121. + #endif
  122.   
  123.     /* Fill in block's parameters and add it to the hash chain where it goes. */
  124.     bp->b_dev = dev;        /* fill in device number */
  125. *** /tmp/,RCSt1a27309    Thu Aug 24 00:02:52 1989
  126. --- const.h    Wed Aug 23 22:55:47 1989
  127. ***************
  128. *** 8,15 ****
  129.   # define NR_BUFS           60    /* # blocks in the buffer cache */
  130.   # define NR_BUF_HASH       64    /* size of buf hash table; MUST BE POWER OF 2*/
  131.   #else
  132. ! # define NR_BUFS           20    /* # blocks in the buffer cache */
  133. ! # define NR_BUF_HASH       32    /* size of buf hash table; MUST BE POWER OF 2*/
  134.   #endif
  135.   #define NR_FDS            20    /* max file descriptors per process */
  136.   #define NR_FILPS          64    /* # slots in filp table */
  137. --- 8,20 ----
  138.   # define NR_BUFS           60    /* # blocks in the buffer cache */
  139.   # define NR_BUF_HASH       64    /* size of buf hash table; MUST BE POWER OF 2*/
  140.   #else
  141. ! #  ifdef BIGGER_BUF
  142. ! #   define NR_BUFS           40    /* # blocks in the buffer cache */
  143. ! #   define NR_BUF_HASH       64    /* size of buf hash table; MUST BE POWER OF 2*/
  144. ! # else
  145. ! #   define NR_BUFS           20    /* # blocks in the buffer cache */
  146. ! #   define NR_BUF_HASH       32    /* size of buf hash table; MUST BE POWER OF 2*/
  147. ! # endif
  148.   #endif
  149.   #define NR_FDS            20    /* max file descriptors per process */
  150.   #define NR_FILPS          64    /* # slots in filp table */
  151. *** /tmp/,RCSt1a27309    Thu Aug 24 00:03:15 1989
  152. --- pipe.c    Sat Aug 19 02:37:51 1989
  153. ***************
  154. *** 29,34 ****
  155. --- 29,35 ----
  156.   #include "glo.h"
  157.   #include "inode.h"
  158.   #include "param.h"
  159. + #include "dev.h"
  160.   #include "fs_proto.h"
  161.   
  162.   PRIVATE message mess;
  163. ***************
  164. *** 309,317 ****
  165.       dev = f->filp_ino->i_zone[0];    /* device on which proc is hanging */
  166.       mess.TTY_LINE = (dev >> MINOR) & BYTE;
  167.       mess.PROC_NR = proc_nr;
  168. ! /* ++ */    mess.COUNT = f->filp_mode;    /* tell kernel whether R or W */
  169.       mess.m_type = CANCEL;
  170.       rw_dev(task, &mess);
  171.       revive(proc_nr, EINTR);    /* signal interrupted call */
  172.     }
  173.   
  174. --- 310,325 ----
  175.       dev = f->filp_ino->i_zone[0];    /* device on which proc is hanging */
  176.       mess.TTY_LINE = (dev >> MINOR) & BYTE;
  177.       mess.PROC_NR = proc_nr;
  178. ! #if 0
  179. !     mess.COUNT = f->filp_mode;    /* tell kernel whether R or W */
  180.       mess.m_type = CANCEL;
  181.       rw_dev(task, &mess);
  182. + #else
  183. +     /* Tell kernel whether R or W. Mode is from current call, not open. */
  184. +     mess.COUNT = (rfp->fp_fd & BYTE) == READ ? R_BIT : W_BIT;
  185. +     mess.m_type = CANCEL;
  186. +     (*dmap[(dev >> MAJOR) & BYTE].dmap_rw)(task, &mess);
  187. + #endif
  188.       revive(proc_nr, EINTR);    /* signal interrupted call */
  189.     }
  190.   
  191. ***************
  192. *** 325,333 ****
  193.           dev = f->filp_ino->i_zone[0];    /* device on which proc is hanging */
  194.           mess.TTY_LINE = (dev >> MINOR) & BYTE;
  195.           mess.PROC_NR = proc_nr;
  196. ! /* ++ */    mess.COUNT = f->filp_mode;    /* tell kernel whether R or W */
  197.           mess.m_type = CANCEL;
  198.           rw_dev(task, &mess);
  199.       }
  200.       rfp->fp_suspended = NOT_SUSPENDED;
  201.       reply(proc_nr, EINTR);    /* signal interrupted call */
  202. --- 333,349 ----
  203.           dev = f->filp_ino->i_zone[0];    /* device on which proc is hanging */
  204.           mess.TTY_LINE = (dev >> MINOR) & BYTE;
  205.           mess.PROC_NR = proc_nr;
  206. ! #if 0    /* this bugfix from bruce evans */
  207. !         mess.COUNT = f->filp_mode;  /* tell kernel whether R or W */
  208.           mess.m_type = CANCEL;
  209.           rw_dev(task, &mess);
  210. + #else
  211. +     /* Tell kernel whether R or W. Mode is from current call, not open. */
  212. +     mess.COUNT = (rfp->fp_fd & BYTE) == READ ? R_BIT : W_BIT;
  213. +     mess.m_type = CANCEL;
  214. +     (*dmap[(dev >> MAJOR) & BYTE].dmap_rw)(task, &mess);
  215. + #endif
  216.       }
  217.       rfp->fp_suspended = NOT_SUSPENDED;
  218.       reply(proc_nr, EINTR);    /* signal interrupted call */
  219.